package com.summer.campussct.pojo.dto;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class RestResult {
    private String code;
    private String msg;
    private Object data;

    public static RestResult success(String msg, Object data){
        return new RestResult("200", msg, data);
    }
    public static RestResult success(Object data){
        return new RestResult("200", "", data);
    }
    public static RestResult success(){
        return new RestResult("200", "", null);
    }

    public static RestResult error(String msg){
        return new RestResult("400", msg, null);
    }

}
